package com.nf.service.impl;

import com.nf.dao.UserDao;
import com.nf.service.UserService;
import com.nf.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service
@Scope("prototype")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao = null;


    public String getUserNameById(String id) {
        User user = userDao.getUserById(id);
        if ("123456".equals(user.getUserPassword())){
            return user.getUserName()+"(弱密码)";
        }
        else {
            return user.getUserName();
        }
    }
}
